package com.smartEdu.controller.app;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.smartEdu.commons.Session;
import com.smartEdu.commons.Tag_Tips;
import com.smartEdu.exception.RequestException;
import com.smartEdu.exception.ServiceException;
import com.smartEdu.response.Response;
import com.smartEdu.service.impl.app.ScheduleServiceImpl;

@Controller
@RequestMapping(value="/app/schedule")
public class ScheduleController extends AppBaseController{
	
	@Autowired
	@Qualifier("scheduleServiceImpl")
	private ScheduleServiceImpl scheduleService;
	
	@Autowired
	@Qualifier(value="appresponse")
	public Response respContext;
	
	@RequestMapping(value="get",method=RequestMethod.POST)
	public void GetSchedule(HttpServletRequest request,HttpServletResponse response){
		Session sess=null;
		try {
			sess=GetSession();
			sess.put(Tag_Tips.REQUEST, GetParameter(request));
			scheduleService.GetScheduleContent(sess);
		} 
		catch (ServiceException e) {
			sess.put(Tag_Tips.RESPCODE, Tag_Tips.ERROR);
		}
		finally {
			SetResponse(response, sess);
		}
	}
	
	@Override
	public String GetRespContent(Session sess){
		return respContext.GetRespContent(sess);
	}
}
